//
//  WYTTextFieldAlertView.m
//  Diary
//
//  Created by 王艺拓 on 15/11/17.
//  Copyright © 2015年 王艺拓. All rights reserved.
//

#import "WYTTextFieldAlertView.h"

@implementation WYTTextFieldAlertView

- (instancetype)init{
    self = [super init];
    if (self) {
        
        [self setUps];
        [self setUpScene];
        self.alpha = 0;
    }
    return self;
}

- (void)setUps{
    self.frame = CGRectMake(kScreenWidth / 3, kScreenHeight / 5 * 2, kScreenWidth / 3 * 2 * 0.5, kScreenWidth / 3 * 2 / 4 * 3 * 0.5);
    [self setUpScene];
    self.alpha = 0.8;
}

- (void)setUpScene{
    self.baseImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.frame), CGRectGetHeight(self.frame))];
    self.baseImageView.image = [UIImage imageNamed:@"shareFailed"];
    [self addSubview:self.baseImageView];
    
    self.AlertLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetHeight(self.baseImageView.frame) / 4 * 2.7, CGRectGetWidth(self.baseImageView.frame), CGRectGetHeight(self.baseImageView.frame) / 4)];
    self.AlertLabel.text = @"网络连接失败";
    self.AlertLabel.textColor = [UIColor whiteColor];
    self.AlertLabel.textAlignment = NSTextAlignmentCenter;
    NSInteger alertLabelFontSize = 15;
    self.AlertLabel.font = [UIFont boldSystemFontOfSize:alertLabelFontSize];
    self.AlertLabel.textColor = [UIColor colorWithRed:64/255.0 green:64/255.0 blue:64/255.0 alpha:1.0f];
    [self.baseImageView addSubview:self.AlertLabel];
    
    self.baseImageView.layer.masksToBounds = YES;
    self.baseImageView.layer.cornerRadius = 5;
}

+ (WYTTextFieldAlertView *)showAlertView{
    WYTTextFieldAlertView *alertView = [[WYTTextFieldAlertView alloc]init];
    alertView.AlertLabel.text = @"不可再编辑";
    return alertView;
}

@end
